from flask import Flask, render_template, jsonify
from handle.analyse import *

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index.html')


@app.route('/line')
def line():
    return jsonify(month_revenue_trend_plot())


@app.route('/bar')
def bar():
    return jsonify(person_count_rank_plot())


@app.route('/pie/revenue')
def revenue():
    return jsonify(revenue_rate_plot())


@app.route('/pie/person')
def person():
    return jsonify(ticket_person_count_rate_plot())


@app.route('/gauge')
def gauge():
    return jsonify(year_on_year_growth_rate())


@app.route('/radar')
def radar():
    return jsonify(month_person_count_radar_plot())


if __name__ == '__main__':
    app.run()
